package cn.crism.blog.repository;

import cn.crism.blog.entity.Comment;
import cn.crism.blog.entity.Reply;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface ReplyRepository extends JpaRepository<Reply,String> {
    List<Reply> findAllByCommentAndReplyStatus(Comment comment,Boolean replyStatus, Sort sort);

    Page<Reply> findAllByComment(Comment comment, Pageable pageable);

    Integer countAllByComment(Comment comment);
}
